<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>

<?php

	include("inc/joomlaInt.php");
	include("inc/inc_configuration.php");
	include("inc/inc_icq.php");
	
	// ini_set( 'display_errors', true );
	// error_reporting( E_ALL );
	
	$sq = "SELECT * FROM $tbl_session WHERE userid<>0 GROUP by userid";
	$sqe = mysql_query($sq);
	$sqc = mySQL_num_rows($sqe);
	
	if ($sqc>0)
	{
		
		while ($row=mysql_fetch_object($sqe))
		{
			$uid=$row->userid;
			$uname=$row->username;
			
			$cQ = "SELECT teamId,name FROM $tbl_combinations c, $tbl_teams t WHERE c.userId=$uid AND c.active=1 AND c.teamId=t.id";
			$cQe = mysql_query($cQ);
			$canz = mySQL_num_rows($cQe);
			
			$teams="";
			
			if ($canz>0)
			{
				while ($trow=mysql_fetch_object($cQe))
				{
					$tid=$trow->teamId;
					$tname=$trow->name;
					
					$teams.="<a class='tooltip'><img src='img/logos/$tid.png' width='20' height='20'><span>$tname</span></a>";
				}
			}
			
			if ($canz==1)
			{
				$teams.="<img src='img/dummy.png' width='20' height='20'>";
			}
		
			$link="";
				
			$q="SELECT * FROM $tbl_ui WHERE userId=$uid";
			$qe=mysql_query($q);
			$qec=mysql_num_rows($qe);
			
			if ($qec>0)
				{
					$qeo=mysql_fetch_object($qe);
					$icq=$qeo->icq;
					if ($icq!=0)
					{
						$link=icqStatus($icq);
					}
				}
			
			echo "$teams $link $uname<br>";
			
			
		}
	}
	else
	{
		echo "Zur Zeit ist niemand online.";
	}
	



?>

</body>
</html>